<html>
<head>
<title>Wedding Site</title>

<style>


	#page_content {
		font-size:30px;
		padding:10px;
		background-color:#000000;
		color:#ffffff;
		margin-top:40px;
		
		/* Display on top of slideshow */
		z-index:2;	
		position:relative; /* This is very important! */	
	}
	
	img#bg {
		/* Stretch background */
		position:fixed;
		top:0;
		left:0;
		height:100%;
		width:100%;
		z-index:0;
	}
	
	#bg_grid {
		position:fixed; /* This is very important! */
		top:0;
		left:0;
		height:100%;
		width:100%;
	 
		z-index:1;
	}


</style>

<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery-1.7.2.js?>"></script>

<script type="text/javascript">
	var aImages = new Array();
	var aURL = new Array();
	var aArtists = new Array();
	var iPrev = -1;
	var iRnd = -1;
	
	aImages[0] = "<?php echo Yii::app()->theme->baseUrl;?>/images/1.jpg";
	aImages[1] = "<?php echo Yii::app()->theme->baseUrl;?>/images/2.jpg";
	aImages[2] = "<?php echo Yii::app()->theme->baseUrl;?>/images/3.jpg";
	aImages[3] = "<?php echo Yii::app()->theme->baseUrl;?>/images/4.jpg";
	aImages[4] = "<?php echo Yii::app()->theme->baseUrl;?>/images/5.jpg";


	
	$(document).ready(function() {
	
		/* Define the function that triggers to fade in the background as soon as the image has loaded */
		$("img#bg").load(function()
			{
				/* Fade in during 3 seconds */
				$("img#bg").fadeTo(3000,1);
				
				/* Animate the picture description during 1 second */
				setTimeout(function() { $("#image_description").animate({right: '+=150'}, 1000) }, 1000);
			
				/* Set the timeout to fade out the image and the description after 10 seconds*/
		    	setTimeout(function() 
			    	{
			    		$("#image_description").animate({right: '-=150'}, 1000);
			    		$("img#bg").fadeOut(2000);
			    		
			    		/* Load the next image after 4 seconds */
			    		setTimeout(LoadImages,2000);
			    	}
			    	,6000);
			}			
		)
	
		/* Start the slideshow one second after the page is ready */ 
		setTimeout(LoadImages,1000);
		
    });

    

    function LoadImage(iNr)
	{
	
		/* Assign the new image to the background */
		$("img#bg").attr("src", aImages[iNr]);
 		
 		/* Assign the artist name to the description */
 		$("#image_artist").html(aArtists[iNr]);
 		
 		/* Assign the image url to the description */
        $("a#image_url").attr("href", aURL[iNr]);
        $("a#image_url").html("for sale @canvasinabox.com");
                        	
    };
    
    function LoadImages()
    {
    	
    	/* Select a random image number and make sure this is not equal to the previous image */
    	while(iPrev == iRnd)
    	{
    		iRnd = Math.floor(Math.random()*aImages.length);
    	}
    	
    	/* Show the selected image */
    	LoadImage(iRnd);
    	
    	iPrev = iRnd;
    	
    };
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="<?php echo Yii::app()->theme->baseUrl;?>/css/style.css" rel="stylesheet" type="text/css">
<!--<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery.jscrollpane.custom.min.js"></script>-->
<!--<link href="<?php echo Yii::app()->theme->baseUrl;?>/css/jquery.jscrollpane.css" rel="stylesheet" type="text/css">-->
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/turn.min.js"></script>

<style type="text/css">
#magazine{
	width:90%;
	height:80%;
	margin-top:4%;
	margin-left:4%;

}

.bord{
	border-width:7px;
  border-style:solid;
  border-color:#ff9900;
}

#magazine .turn-page{
	background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/green.jpg);
	background-size:100% 100%; 
}

.home{
	border-radius:15px;
	-moz-border-radius:15px;
	-webkit-border-radius:15px;
}
</style>

</head>

<body>

 <img id="bg" style="display:none" />
<div id="bg_grid">

<!--Background Audio Player-->
    <?php
    Yii::import('application.extensions.aii-publish-register-behavior.AiiPublishRegisterBehavior');
    Yii::import('application.extensions.aii-audio-player.AiiAudioPlayer');
    $this->widget(
        'AiiAudioPlayer',
        array (
            'playerID' => 'mpl',        
            'singlePlayer' => true,
            'trackOptions'=> array( 'soundFile' => 'Aarya2.mp3' , 'alternative' => 'nothing' ),
            'flashPlayerOptions' => array( 'width' => 75 ),
    ));
?>
  
<div id="magazine" class="border">
	<div id="p1" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/page1.jpg);"></div>
	<div id="p2" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/couple1.jpg);"></div>
	<div id="p3" class="bord">
	
	<div style="margin-top: 35px;margin-left: 15px;margin-right: 15px;margin-bottom: 20px;">	<?php $this->renderPartial('home'); ?>  </div>
				</div>

	<div id="p4" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/couple1.jpg);"></div>
	<div id="p5" class="bord" >
	
		<div style="margin-top: 35px;margin-left: 15px;margin-right: 15px;margin-bottom: 20px;">
				<?php $this->renderPartial('ourstory'); ?>
		</div>

	</div>
	<div id="p6">
		<div class="prad"></div>
	</div>
	<div id="p7"class="bord">
			<?php $this->renderPartial('photoalbum'); ?>
  </div>
	<div id="p8" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/couple1.jpg);"></div>
 <div id="p9"class="bord" > <div style="margin-top: 35px;margin-left: 15px;margin-right: 15px;margin-bottom: 20px;">
  <?php $this->renderPartial('poll'); ?>  </div>
  </div>
	<div id="p10" class="bord"  style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/couple1.jpg);"></div>
	<div id="p11" class="bord"><div style="margin-top: 35px;margin-left: 15px;margin-right: 15px;margin-bottom: 30px;">
  		<?php $this->renderPartial('guestbook'); ?></div>
  	</div>
    	<div id="p12" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/couple1.jpg);"></div>
	<div id="p13" class="bord" ><div style="margin-top: 35px;margin-left: 15px;margin-right: 15px;margin-bottom: 30px;">
  <?php $this->renderPartial('invitation'); ?></div>
  </div>
	<div id="p14" class="bord" style="background-image:url(<?php echo Yii::app()->theme->baseUrl;?>/images/page1.jpg);"></div>
</div>
  </div>


<script type="text/javascript">

	$(window).ready(function() {
		$('#magazine').turn({
							display: 'double',
							acceleration: true,
							gradients: !$.isTouch,
							elevation:50,
             
							when: {
								turned: function(e, page) {
              
									/*console.log('Current view: ', $(this).turn('view'));*/
								}
							}
						});
	});
	
	$(window).bind('keydown', function(e){
		
		if (e.keyCode==37)
			$('#magazine').turn('previous');
		else if (e.keyCode==39)
			$('#magazine').turn('next');
			
	});
</script>

<script type="text/javascript">
  function getBote(id)
{

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("p4").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","<?php echo Yii::app()->createUrl('booklet/photo');?>?g="+id,true);
xmlhttp.send();
}

function getNote()
{
	if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("p7").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","<?php echo Yii::app()->createUrl('booklet/photoalbum');?>",true);
xmlhttp.send();
}
</script>
</body>
</html>